/**
 * 
 */
package sailing.managers.impl;

import java.util.List;

import sailing.dao.BillsDetailDao;
import sailing.entity.BillsDetail;
import sailing.managers.BillsDetailManager;
import cjlite.annotations.Inject;
import cjlite.utils.Lists;

/**
 * @author simon
 * 
 */
public class BillsDetailManagerImpl implements BillsDetailManager {

	private List<BillsDetail> billsDetailList = Lists.newArrayList();

	@Inject
	private BillsDetailDao dao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see sailing.managers.CustomerManager#save(sailing.entity.Customer)
	 */
	@Override
	public String save(BillsDetail b) {
		if (dao.save(b)) {
			return "";
		}
		return "添加失败！";
	}


	@Override
	public List<BillsDetail> getAllBillsDetailList() {
		List<BillsDetail> list = dao.getAllList();
		if (list == null) {
			return Lists.newArrayList();
		}
		billsDetailList.clear();
		billsDetailList.addAll(list);
		return list;
	}

	@Override
	public void delete(BillsDetail b) {
		boolean result = dao.delete(b);
	}

	@Override
	public String update(BillsDetail b) {
		if (dao.update(b)) {
			return "";
		}
		return "保存数据失败！";
	}
	
	@Override
	public boolean saveList(List<BillsDetail> dataList) {
		return false;
	}

}
